<?php
declare (strict_types = 1);

namespace app\api\controller\order;

use app\api\controller\Base;
use app\common\service\lib\Pay\AliPayFactory;
use app\common\service\PayService;
use think\Request;

class Pay extends Base
{
   public function aliPay(Request $request)
   {
       $params = $request->get();
       return PayService::pay($params);
   }

    public  function returnUrl()
    {
        AliPayFactory::returnUrl();
    }

    public  function notifyUrl()
    {
        AliPayFactory::notify();
    }

    public function refund(Request $request)
    {
        $params = $request->get();
        return PayService::refund($params);
    }

    public function find(Request $request)
    {
        $order_id = $request->get('order_id');
        PayService::find($order_id);
    }

    public function yue(Request $request)
    {
        $params = $request->get();
        $params['uid'] = $request->uid;
        $info = PayService::balancePay($params);
        return $this->res($info);
    }



}
